//
//  ADViewController.m
//  carSecretary
//
//  Created by huangliru on 14-9-4.
//  Copyright (c) 2014年 huangliru. All rights reserved.
//

#import "ADViewController.h"
#import "LoginViewController.h"
@interface ADViewController ()

@end

@implementation ADViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    // 初始化广告图片
    self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 568)];
    
//    // 获取服务器图片
//    NSURL *url=[NSURL URLWithString:@"http://www.3tixa.com:28088/greenland/r/imageUpload/greenland/201408181625086060.jpg"];
//    UIImage *imgFromUrl =[[UIImage alloc]initWithData:[NSData dataWithContentsOfURL:url]];
//    UIImageView *imgView = [[UIImageView alloc]initWithImage:imgFromUrl];
//    self.imageView.image = imgView.image;
    self.imageView.image = [UIImage imageNamed:@"ad.jpg"];
    [self.view addSubview:self.imageView];
}
// 跳转至登陆界面
-(void)nextView
{
    LoginViewController *loginVC = [[LoginViewController alloc]init];
    [self presentViewController:loginVC animated:NO completion:nil];
}
// 停留4s跳转
-(void)viewDidAppear:(BOOL)animated
{
    
    [self performSelector:@selector(nextView) withObject:0 afterDelay:4];
    
}
// 设置广告图片链接
// 点击图片链接网址
-(void)imageClicked
{
    
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
